package com.cakin.javademo;

/**
 * @ClassName: NumberNdemo3
 * @Description: TODO
 * @Date: 2020/6/14
 * @Author: cakin
 */
public class NumberNdemo3 {
    public static void main(String[] args) {
        double[] nums = { 1.45, 1.55, 1.65, -1.45, -1.55, -1.65 };
        for (double num : nums) {
            test(num);
        }
    }

    private static void test(double num) {
        System.out.println("Math.floor(" + num + ")=" + Math.floor(num)); // 1 1 1 -2 -2 -2
        System.out.println("Math.round(" + num + ")=" + Math.round(num)); // 1 2 2 -1  -2 -2
        System.out.println("Math.ceil(" + num + ")=" + Math.ceil(num));   // 2 2 2 -1 -1 -1
        Character a = 'a';
        System.out.println(a);
    }
}

